<?php
/**
 * 定义f:button控件
 * 
 * 除了f:button外，还可以使用f:submit, f:reset, f:image
 * 
 * 可以使用的参数有：
 * - type <string> 按钮类型，可以为submit, reset, image, button
 *
 * @since 1.1.0
 * @package if
 * @subpackage module.ui
 */
class UIFormButton extends UIFormElement {
	protected $tpl = "form_button";
	
	function _after_parse() {
		parent::_after_parse();
		$type = $this->attr("type");
		if (!$type) {
			switch ($this->name()) {
				case "f:submit": $this->setAttr("type", "submit"); break;
				case "f:reset": $this->setAttr("type", "reset"); break;
				case "f:image": $this->setAttr("type", "image"); break;
				default: $this->setAttr("type", "button");
			}
		}
	}
}

?>